<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Tim kiem trong file</title>
<style type="text/css">
<!--
.style1 {
	font-family: MERcuriusScript, MYstical, NUeva;
	font-size: 20px;
	color: #CA4B00;
}
.style2 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: smaller;
}
-->
</style>
</head>

<body>
<form id="form1" name="form1" method="post" action="Bai4_5.php">
  <table width="400" border="0" align="center" cellpadding="2" cellspacing="2" bgcolor="#FFEBCA">
    <tr bgcolor="#BDBAE7">
      <td colspan="2" bgcolor="#FFCC66"><div align="center"><span class="style1">KIỂM TRA FILE SIZE</span></div></td>
    </tr>
    <tr>
      <td width="93"><span class="style2">Tên file: </span></td>
      <td width="393" align="center">
          <input name="ten_file" type="text" id="ten_file" size="40" value="<?php echo $_POST["ten_file"];?>"/>
     </td>
    </tr>
    <tr>
      <td colspan="2" align="center">
        <input type="submit" name="Submit" value="Kiểm tra" />      </td>
    </tr>
  </table>
</form>
<?php
	if(isset($_POST['ten_file']))
	{
		$ten_file=$_POST['ten_file'];
		if(!file_exists($ten_file))
		{
			echo "<p align='center'>Không tồn tại file này</p>";	
		}
		else
		{
			$size=filesize($ten_file);
			echo "<p align='center'>Kích thước file $ten_file là $size byte(s)</p>";
		}
	}
	else
		echo "Chưa nhập tên file";
?>
</body>
</html>
